package cn.tedu.egcar1.controller;

import cn.tedu.egcar1.base.response.JsonResult;
import cn.tedu.egcar1.mapper.NoticeMapper;
import cn.tedu.egcar1.pojo.vo.NoticeListQuery;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@Api(tags = "03.公告管理")
@RequestMapping("/v1/notice/")
public class NoticeController {
    @Autowired
    private NoticeMapper noticeMapper;
    @GetMapping("list")
    @ApiOperation("公告列表")
    @ApiOperationSupport(order = 10)
    public JsonResult list(){
       List<NoticeListQuery>  noticeListQueries=noticeMapper.noticeList();
       return JsonResult.ok(noticeListQueries);
    }
}
